package com.leyou.user.inter.api;

import com.leyou.common.bean.Result;
import com.leyou.common.bean.ServerConstant;
import com.leyou.user.inter.fallback.AuthorizeServiceFallbackFactory;
import com.leyou.user.inter.pojo.Role;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * @author zqq
 * @ClassName IAuthorizeService
 * @Description
 * @date 2020/3/24-21:50
 */
@Component
@FeignClient(value = ServerConstant.USER_SERVICE_ID, fallbackFactory = AuthorizeServiceFallbackFactory.class)
public interface IAuthorizeService {

    @RequestMapping(value = "/author/query/role/{uid}", method = RequestMethod.GET, consumes = MediaType.APPLICATION_JSON_VALUE)
    Result<List<Role>> queryRoleByUid(@PathVariable(value = "uid") Long uid);
}
